global infile "DataMain.dta"

	 
* Table 2. Water statistics

use "$infile", clear
drop if dupindicator == 1

gen ch1 = (cohort == 1)
gen ch2 = (cohort == 2)
gen ch3 = (cohort == 3)

sum water logwater wbath wkitchen if cohort == 1
sum water logwater wbath wkitchen if cohort == 1 & treat == 0
sum water logwater wbath wkitchen if cohort == 1 & treat == 1

sum water logwater if cohort == 2
sum water logwater if cohort == 2 & treat == 0
sum water logwater if cohort == 2 & treat == 1

sum water logwater if cohort == 3
sum water logwater if cohort == 3 & treat == 0
sum water logwater if cohort == 3 & treat == 1

sum water logwater
sum water logwater if treat == 0
sum water logwater if treat == 1

unique(home) if wbath != . & wkitchen != . & cohort == 1
unique(home) if wbath != . & wkitchen != . & cohort == 1


* F-tests water statistics

reg water ch1 ch2 ch3 if treat == 0, nocon
test _b[ch1] == _b[ch2] = _b[ch3]
reg logwater ch1 ch2 ch3 if treat == 0, nocon
test _b[ch1] == _b[ch2] = _b[ch3]

reg water ch1 ch2 ch3, nocon
test _b[ch1] == _b[ch2] = _b[ch3]
reg logwater ch1 ch2 ch3, nocon
test _b[ch1] == _b[ch2] = _b[ch3]


* Table 2. Apartment characteristics

duplicates drop home, force

tab rooms 
sum rent, d

drop if rooms == . | m2 == . | rent == .
unique(home)
duplicates drop home, force
sum rooms m2 rent
sum rooms m2 rent if cohort == 1
sum rooms m2 rent if cohort == 2
sum rooms m2 rent if cohort == 3


* F-tests apartment characteristics

reg rooms ch1 ch2 ch3, nocon
test _b[ch1] == _b[ch2] = _b[ch3]
reg m2 ch1 ch2 ch3, nocon
test _b[ch1] == _b[ch2] = _b[ch3]
reg rent ch1 ch2 ch3, nocon
test _b[ch1] == _b[ch2] = _b[ch3]
